package cate.common.table.farm.island.sheet;

import cate.common.table.ESheet;
import cate.common.table.farm.island.row.IslandMapLevelRow;
import easy.java.dev.note.NoteClass;

import java.util.ArrayList;
import java.util.List;

@NoteClass(value = "迷失神庙地图")
public class IslandMapLevelSheet extends ESheet<IslandMapLevelRow> {

    @Override
    public String getSheetName() {
        return "迷失神庙地图";
    }

    public List<IslandMapLevelRow> getMapDetail(int mapTid) {
        List<IslandMapLevelRow> result = new ArrayList<>();
        for (IslandMapLevelRow row : this.getList()) {
            if (row.mapTid == mapTid) {
                result.add(row);
            }
        }
        return result;
    }

    public IslandMapLevelRow getMapDetail(int mapTid, int level) {
        for (IslandMapLevelRow row : this.getList()) {
            if (row.mapTid == mapTid && row.level == level) {
                return row;
            }
        }
        return null;
    }
}
